HAPPY BIRTHYAYDAY TISMISUUU ♥️
A little date-unlock birthday surprise — enter the date to reveal the next memory!
Progress
0 / 17 unlocked
Gallery
Locked thumbnails hide until unlocked in order.
} } }); gallery.appendChild(tile); }); progressText.textContent = `${unlockedIndex} / ${entries.length} unlocked`; } function status(msg, type='info'){ statusEl.textContent = msg; statusEl.style.color = (type==='error') ? '#b43a3a' : (type==='warn' ? '#8a6d3b' : 'var(--muted)'); setTimeout(()=> { if(statusEl.textContent === msg) statusEl.textContent = ''; }, 5000); } function tryUnlock(dateStr){ if(unlockedIndex >= entries.length){ status('All items already unlocked! 🎉'); return; } const expected = entries[unlockedIndex].date; if(!expected || expected === 'YYYY-MM-DD'){ status('The next entry has a placeholder date. Please edit the code and set a real date (YYYY-MM-DD).', 'error'); return; } if(dateStr === expected){ unlockedIndex += 1; localStorage.setItem(STORAGE_KEY, unlockedIndex); renderGallery(); revealAndCelebrate(unlockedIndex-1); status('Nice! Image unlocked. ❤️'); } else { status(`Date doesn't match. Keep trying!`, 'error'); } } function openModal(index){ const e = entries[index]; modalImage.src = e.img; modalTitle.textContent = `#${index+1} — ${e.text}`; modalText.textContent = `Unlocked on: ${e.date}`; modal.classList.add('open'); modal.setAttribute('aria-hidden', 'false'); } closeModal.addEventListener('click', () => { modal.classList.remove('open'); modal.setAttribute('aria-hidden', 'true'); }); modal.addEventListener('click', (ev) => { if(ev.target === modal) { modal.classList.remove('open'); modal.setAttribute('aria-hidden','true'); } }); function revealAndCelebrate(index){ confetti({ particleCount: 120, spread: 70, origin: { y: 0.35 } }); setTimeout(()=> openModal(index), 300); } resetBtn.addEventListener('click', () => { if(confirm('Reset all progress? This will lock all images again.')) { unlockedIndex = 0; localStorage.removeItem(STORAGE_KEY); renderGallery(); status('Progress reset.'); } }); submitBtn.addEventListener('click', () => { const val = dateInput.value; if(!val){ status('Please enter a date to try to unlock.', 'warn'); return; } tryUnlock(val); dateInput.value = ''; }); dateInput.addEventListener('keydown', (e) => { if(e.key === 'Enter') { e.preventDefault(); submitBtn.click(); } }); renderGallery();